//package com.sunlands.deskmate.message.handler.sender;
//
//import com.alibaba.fastjson.JSONObject;
//import com.sunlands.deskmate.config.RabbitMqConfig;
//import com.sunlands.deskmate.message.entity.Messages;
//import com.sunlands.deskmate.util.SpringUtils;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.amqp.rabbit.core.RabbitTemplate;
//
//import java.util.List;
//
//import static com.sunlands.deskmate.config.RabbitMqConfig.EXCHANGE_SUCCESS;
//
///**
// * @Author: anjunling@sunlands.com
// * @Description:
// * @Date: Create in 20:38 2018/6/5
// * @Modified By:
// */
//@Slf4j
//public abstract class AbstractMessageSender {
//
//    private RabbitTemplate rabbitTemplate;
//
//    protected AbstractMessageSender() {
//        rabbitTemplate = SpringUtils.getBean(RabbitTemplate.class);
//    }
//
//    protected void success(List<Messages> messages) {
//        if (messages == null || messages.isEmpty()) {
//            return;
//        }
//
//        rabbitTemplate.convertAndSend(EXCHANGE_SUCCESS, SpringUtils.getBean(RabbitMqConfig.class).getEnv(), messages);
//
//        log.debug("send success exchange {} size = {} messages {}", EXCHANGE_SUCCESS, messages.size(), JSONObject.toJSONString(messages));
//    }
//
//}
